﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _1.OrderService
{
    public partial class Form1 : Form
    {
        OrderService orderService;
        public Form1()
        {
            InitializeComponent();
            orderService = new OrderService();
            Order t1 = new Order(514, "红茶", "野兽先辈", 5.14);
            Order t2 = new Order(1919, "霸王龙", "野兽先辈", 11.4);
            Order t3 = new Order(810334, "林檎", "木村", 8.10);
            Order t4 = new Order(893364, "软手机", "三浦", 19.19);
            Order t5 = new Order(191919, "美味的意面", "我修院", 33.4);
            Order t6 = new Order(114, "美味的蔬菜棒", "德川", 89.3);
            orderService.addOrder(t1);
            orderService.addOrder(t2);
            orderService.addOrder(t3);
            orderService.addOrder(t4);
            orderService.addOrder(t5);
            orderService.addOrder(t6);
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button_query_Click(object sender, EventArgs e)
        {
            QueryForm queryForm = new QueryForm(this,orderService);
            queryForm.Show();
            this.Hide();
        }

        private void button_add_Click(object sender, EventArgs e)
        {
            AddOrderForm addOrderForm = new AddOrderForm(this, orderService);
            addOrderForm.Show();
            this.Hide();
        }

        private void button_delete_Click(object sender, EventArgs e)
        {
            DeleteForm deleteForm = new DeleteForm(this, orderService);
            deleteForm.Show();
            this.Hide();
        }

        private void button_modify_Click(object sender, EventArgs e)
        {
            ModifyForm modifyForm = new ModifyForm(this, orderService);
            modifyForm.Show();
            this.Hide();
        }

        private void button_sort_Click(object sender, EventArgs e)
        {
            SortForm sortForm = new SortForm(this,orderService);
            sortForm.Show();
            this.Hide();
        }

        private void button_imexport_Click(object sender, EventArgs e)
        {
            ExportOrImportForm exportOrImportForm = new ExportOrImportForm(this, orderService);
            exportOrImportForm.Show();
            this.Hide();
        }

        private void button_close_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
